/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import entity.Contact;
import entity.RegisteredUser;
import java.io.Serializable;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import manager.RegisteredUserManager;

/**
 *
 * @author Stefan
 */
@ManagedBean
@SessionScoped
public class RegisteredUserBean implements Serializable {

    protected RegisteredUser registeredUser;
    protected boolean loggedIn;

    /** Creates a new instance of RegisteredUserBean */
    public RegisteredUserBean() {
        loggedIn = false;
    }

    public boolean isLoggedIn() {
        return loggedIn;
    }

    public void setLoggedIn(boolean loggedIn) {
        this.loggedIn = loggedIn;
    }

    public RegisteredUser getRegisteredUser() {
        return registeredUser;
    }

    public void setRegisteredUser(RegisteredUser registeredUser) {
        this.registeredUser = registeredUser;
    }

    public Integer getPendingInvitationsCount() {
        RegisteredUserManager rum = new RegisteredUserManager();
        return rum.getPendingInvitationsCount(registeredUser);
    }

    public List<Contact> getNonDeletedContacts() {
        RegisteredUserManager rum = new RegisteredUserManager();
        return rum.getNonDeletedContacts(registeredUser);
    }
}
